package com.itheima.Jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

/**
 * 解析数据,解析官网的所有课程
 */
public class Read_Jsoup {
    public static void main(String[] args) throws Exception {
        //确定url
        String url = "http://www.itcast.cn";
        //获取document对象
        Document document = Jsoup.connect(url).get();
        //选择器的方式
        Elements elements = document.select(".nav_txt a");
        for (Element element : elements) {
            System.out.println(element.text());
        }
    }
}
